#pragma once
#pragma warning(disable:4996)       // disable checked iterator errors http://msdn.microsoft.com/en-us/library/aa985965(VS.80).aspx 

//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101

#include <Macros.h>
#include <CoVector.h>
#include <CoMatrix.h>
#include <CoCube.h>
#include <ValueHelpers.h>
#include <Settings.h>

#include <gen/QL/Quote.h>
#pragma unmanaged 
#include <ql\quotes\futuresconvadjustmentquote.hpp>
#include <boost/smart_ptr/detail/spinlock.hpp>
#pragma managed 

using namespace System;
using namespace QuantLib;
using namespace Cephei;

using namespace Cephei::QL::Indexes;
using namespace Cephei::QL;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
namespace Cephei { namespace QL { namespace Quotes {
	//////////////////////////////////////////////////////////////////////////////////////////////
	// implementation of IFuturesConvAdjustmentQuote
	public ref class CFuturesConvAdjustmentQuote : 
            public CQuote,
            public Cephei::QL::Quotes::IFuturesConvAdjustmentQuote
	{
	protected: 
		boost::shared_ptr<QuantLib::FuturesConvAdjustmentQuote>* _ppFuturesConvAdjustmentQuote;
#ifdef HANDLE
		QuantLib::Handle<QuantLib::FuturesConvAdjustmentQuote>* _phFuturesConvAdjustmentQuote;
#endif
		Object^ _FuturesConvAdjustmentQuoteOwner;     // reference to object that manages the storage for this object
	internal:
		CFuturesConvAdjustmentQuote (Cephei::QL::Indexes::IIborIndex^ index, String^ immCode, Cephei::QL::IQuote^ futuresQuote, Cephei::QL::IQuote^ volatility, Cephei::QL::IQuote^ meanReversion);
		CFuturesConvAdjustmentQuote (Cephei::QL::Indexes::IIborIndex^ index, DateTime futuresDate, Cephei::QL::IQuote^ futuresQuote, Cephei::QL::IQuote^ volatility, Cephei::QL::IQuote^ meanReversion);
        CFuturesConvAdjustmentQuote (boost::shared_ptr<QuantLib::FuturesConvAdjustmentQuote>& childNative, Object^ owner);
        CFuturesConvAdjustmentQuote (QuantLib::FuturesConvAdjustmentQuote& childNative, Object^ owner);
        CFuturesConvAdjustmentQuote (CFuturesConvAdjustmentQuote^ copy);
        CFuturesConvAdjustmentQuote (System::Type^ t);
#ifdef STRUCT
        CFuturesConvAdjustmentQuote (QuantLib::FuturesConvAdjustmentQuote childNative);
#endif       
#ifdef HANDLE
		CFuturesConvAdjustmentQuote (QuantLib::Handle<QuantLib::FuturesConvAdjustmentQuote>& childNative, Object^ owner);
		CFuturesConvAdjustmentQuote (QuantLib::Handle<QuantLib::FuturesConvAdjustmentQuote> childNative);
#endif
		virtual ~CFuturesConvAdjustmentQuote ();
		!CFuturesConvAdjustmentQuote ();

	internal:
		QuantLib::FuturesConvAdjustmentQuote& GetReference ();
		boost::shared_ptr<QuantLib::FuturesConvAdjustmentQuote>& GetShared ();
		QuantLib::FuturesConvAdjustmentQuote* GetPointer ();
        void SetFuturesConvAdjustmentQuote (boost::shared_ptr<QuantLib::FuturesConvAdjustmentQuote> native)
        {
            if (_ppFuturesConvAdjustmentQuote != NULL)
                delete _ppFuturesConvAdjustmentQuote;
            _ppFuturesConvAdjustmentQuote = new boost::shared_ptr<QuantLib::FuturesConvAdjustmentQuote> (native);
            SetQuote (boost::dynamic_pointer_cast<QuantLib::Quote> (*_ppFuturesConvAdjustmentQuote));
        }
#ifdef HANDLE
		QuantLib::Handle<QuantLib::FuturesConvAdjustmentQuote>& GetHandle ();
#endif
		virtual bool HasNative () override;
    public:
        property Double FuturesValue 
        {
		    virtual Double get () ;
        }
        property DateTime ImmDate 
        {
		    virtual DateTime get () ;
        }
        property Boolean IsValid 
        {
		    virtual Boolean get () ;
        }
        property Double MeanReversion 
        {
		    virtual Double get () ;
        }
        property Cephei::QL::Quotes::IFuturesConvAdjustmentQuote^ Update 
        {
		    virtual Cephei::QL::Quotes::IFuturesConvAdjustmentQuote^ get () ;
        }
        property Double Value 
        {
		    virtual Double get () ;
        }
        property Double Volatility 
        {
		    virtual Double get () ;
        }
    };
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Factory class
	public ref class CFuturesConvAdjustmentQuote_Factory : public System::MarshalByRefObject,  public IFuturesConvAdjustmentQuote_Factory
	{
	public:
        virtual IFuturesConvAdjustmentQuote^ Create (Cephei::QL::Indexes::IIborIndex^ index, String^ immCode, Cephei::QL::IQuote^ futuresQuote, Cephei::QL::IQuote^ volatility, Cephei::QL::IQuote^ meanReversion);
        virtual IFuturesConvAdjustmentQuote^ Create (Cephei::QL::Indexes::IIborIndex^ index, DateTime futuresDate, Cephei::QL::IQuote^ futuresQuote, Cephei::QL::IQuote^ volatility, Cephei::QL::IQuote^ meanReversion);
    };
   
/*Cephei*/ } /*QL*/ } /*Quotes */}
